module.exports = {
  publicPath: "./",
  outputDir: "dist", //构建时输出的目录
  assetsDir: "staic", //放置静态资源目录
  indexPath: "index.html", //html 输出路径
  filenameHashing: true, //文件名哈希值
  productionSourceMap: false,
  pages: {
    index: {
      entry: "src/main.js", //page 入口文件
      template: "public/index.html", //模板文件
      filename: "index.html", //在dist/index.html 的输出文件
      title: "考试",
    },
  },
  configureWebpack: {},

  devServer: {
    // open: process.platform === 'darwin',
    host: "0.0.0.0",
    port: 8055,
    open: true, //配置自动启动浏览器
    proxy: {
      "/voice": {
        //
        target: "http://localhost:8085", //对应服务器的接口
        changeOrigin: true,
        // pathRewrite: {
        //   "^/api": "/",
        // },
      },
      "/platform": {
        target: "http://192.168.15.238:6085", //对应服务器的接口 117.160.141.22:6085  192.168.15.33:6085
        changeOrigin: true,
        // pathRewrite: {
        //   "^/platform": "/",
        // },
      },
      "/login": {
        target: "http://192.168.15.238:6085", //对应服务器的接口
        changeOrigin: true,
        // pathRewrite: {
        //   "^/platform": "/",
        // },
      },
      "/api": {
        //
        target: "http://192.168.15.33:6105", //对应服务器的接口
        changeOrigin: true,
        pathRewrite: {
          "^/api": "",
        },
      },
      // "/": {
      //   target: "http://192.168.15.33:6105",
      //   changeOrigin: true,
      //   pathRewrite: {
      //     "^/": "",
      //   },
      // },
    },
  },
  css: {
    loaderOptions: {
      sass: {
        data: `@import "@/assets/css/_style.scss";`,
      },
    },
  },

  // css: {
  //   loaderOptions: {
  //     sass: {
  //       additionalData: `@import "@/assets/css/_style.scss";`, // 引入定义变量的路径
  //     },
  //   },
  // },
};
